package c.x.jy.bean.event;

import org.springframework.context.ApplicationEvent;

import c.x.jy.common.utils.SysUtils;

@SuppressWarnings("serial")
public class BaseEvent<T> extends ApplicationEvent {

    protected String eventId;

    protected T data;

    public BaseEvent(Object source) {
        super(source);
        eventId = SysUtils.generateCode();
    }
 
    public String getEventId() {
        return eventId; 
    }

    public void setEventId(String eventId) {
        this.eventId = eventId;
    }

    public T getData() {
        return data;
    }

    public BaseEvent<T> setData(T data) {
        this.data = data;
        return this;
    }
}
